﻿@page
@model IndexModel
@{
    ViewData["Title"] = "Response Caching Middleware";
}

<h1>@ViewData["Title"]</h1>

<div class="row">
    <div class="col-md-6">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Instructions</h3>
            </div>
            <div class="panel-body">
                <p>Current server time at time of page generation: @System.DateTime.Now</p>
                <p>The app responds with its Index page, including a <code>Cache-Control</code> header to configure caching behavior. The app also sets the <code>Vary</code> header to configure the cache to serve the response only if the <code>Accept-Encoding</code> header of subsequent requests matches that from the original request.</p>
                <p>When running the sample, the Index page is served from cache when stored and cached for up to 10 seconds.</p>
                <p>Don't use a browser to test caching behavior. Browsers often add a cache control header on reload that prevent the middleware from serving a cached page. For example, a <code>Cache-Control</code> header with a value of <code>max-age=0</code> might be added by the browser. To test caching behavior, use a developer tool that permits setting the request headers explicitly, such as <a href="https://www.telerik.com/fiddler">Fiddler</a> or <a href="https://www.getpostman.com/">Postman</a>.</p>
            </div>
        </div>
    </div>
</div>
